import React, { Component } from 'react'
import { Consumer } from '../utils/context'
// import { Consumer } from './GrandFather'

export default class Son extends Component {
    render() {
        return (
            <div>
                {/* <h5>
                    Son
                </h5> */}
                {/* Consumer  必须写一个函数 */}
                <Consumer>
                    {
                        (data) => {
                            return <div>
                                <h5>
                                    Son --- { data }
                                </h5>
                            </div>
                        }
                    }
                </Consumer>
            </div>
        )
    }
}
